#{extends 'main.html' /}

#{messages.setI18nTitle key:'views.users.login.title' /}


<div class="view-data">
    <h1>Autenticar utilizador</h1>
    
    
    <p class="spacer"></p>
	#{form @Users.authenticate(), id:'loginForm'}
		<fieldset>
			<legend>Introduza o seu email e password</legend>
          
           
            #{field 'email'}
                <div class="${field.errorClass}">
                    <label for="${field.name}">Email: </label>
                    <input type="text" name="${field.name}" id="${field.name}" size="20" maxlength="60" value="${email}" />
                    #{ifErrors}
                        <span class="error">${field.error}</span>
                    #{/ifErrors}
                </div>
                
                
            #{/field}


            #{field 'password'}
                <div class="${field.errorClass}">
                    <label for="${field.name}">Password: </label>
                    <input type="password" name="${field.name}" id="${field.name}" size="20" maxlength="60" value="" />
                    #{ifErrors}
                        <span class="error">${field.error}</span>
                    #{/ifErrors}
            	</div>
            #{/field}
            
			#{field 'keepLogged'}
                <div class="${field.errorClass}">
                    <input type="checkbox" name="${field.name}" value="true" ${(params[field.name] ? params.getAll(field.name)[0] == 'true' : _value) ? 'checked="true"'.raw() : ''} id="${field.name}"/>
                    <label class="checkbox" for="${field.name}">Manter a sessão activa durante 30 dias</label>
                    <div class="clearfix"></div>
                    #{ifErrors}
                        <span class="error">${field.error}</span>
                    #{/ifErrors}
            	</div>
            #{/field}

            
            
                        
		    <div class="buttons">
		    	<input type="submit" value="&{'forms.login.authenticate'}"> 
            </div> 
            <div>
            	<a href="@{Users.recoverPassword}">Esqueceu-se da password? </a>
            </div>       

            <div>
            	<a href="@{Users.blank(models.enums.UserType.USER)}">Ainda não tem conta? </a>
            </div>       
			
		</fieldset>
	 
	#{/form}
    
 </div>
